<template>
	<view class="web">
		<view class="web_head">
			<view class="web_head_nav" :style="{height:statusBarHeight}"></view>
			<view class="web_head_con" @click="returnTop">
				<image src="/static/icon/1_icon36@2x.png" mode=""></image>
				<text>支付</text>
				<text></text>
			</view>
		</view>
		<web-view :src="url"></web-view>
	</view>
</template>

<script>
	var wv;//计划创建的webview
	var statusBarHeight = uni.getSystemInfoSync().statusBarHeight
	export default {
		data() {
			return {
				url:'',
				statusBarHeight:statusBarHeight + 'px',
			};
		},
		methods:{
			returnTop () {
				uni.switchTab({url:'/pages/tabbar/mine'})
			}
		},
		onLoad ({url}) {
			this.url = uni.getStorageSync('url')
		},
		onReady() {
		// #ifdef APP-PLUS
		var currentWebview = this.$scope.$getAppWebview() //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效
		setTimeout(()=> {
				wv = currentWebview.children()[0]
				wv.setStyle({top:statusBarHeight + 44,height:700})
		}, 1000); //如果是页面初始化调用时，需要延时一下
		// #endif
		}
	}
</script>
<style>
	page {
		background: #FFFFFF;
	}
</style>
<style lang="scss">
	.web_head,.web_head {
		width: 100%;
	}
	.web_head  {
		position: fixed;
		top: 0;
		z-index: 9999999999;
	}
.web_head_con {
	width: 100%;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 30rpx;
	text {
		font-weight: bold;
		font-size: 32rpx;
		&:last-child {
			width: 24rpx;
			height: 36rpx;
		}
	}
	image {
		width: 24rpx;
		height: 36rpx;
		display: block;
	}
}
web-view {
	height: 200rpx;
}
</style>
